import com.sheep.opt.DbConnector;

import java.sql.Connection;

/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 2011-7-26
 * Time: 10:22:35
 * To change this template use File | Settings | File Templates.
 */
public class ConstructTester {
    public static void main(String[] args) throws Exception{
            DbConnectorTest();
    }


    //log4j测试
    private static void log4jTest(){

    }

    //数据库连接测试
    private static void DbConnectorTest() throws Exception{
        System.out.println("数据库连接模块测试开始……");
        Connection conn = null;

        conn = DbConnector.getConn();
        if(conn != null){
            System.out.println("DbConnector.getConn():yes");
            conn.close();
        }else{
            System.out.println("DbConnector.getConn():no");
        }

        conn = DbConnector.getConn_ds();
        if(conn != null){
            System.out.println("DbConnector.getConn_ds():yes");
            conn.close();
        }else{
            System.out.println("DbConnector.getConn_ds():no");
        }

        conn = DbConnector.getConn_pool();
        if(conn != null){
            System.out.println("DbConnector.getConn_pool():yes");
            conn.close();
        }else{
            System.out.println("DbConnector.getConn_pool():no");
        }

        conn = DbConnector.getConn_jdbc();
        if(conn != null){
            System.out.println("DbConnector.getConn_jdbc():yes");
            conn.close();
        }else{
            System.out.println("DbConnector.getConn_jdbc():no");
        }        

        System.out.println("数据库连接模块测试结束……");
    }
}
